<template>
  <el-table
    :data="tableData"
    style="width: 100%"
    :height="tableInfo.tableHeight"
    :header-cell-style="headerCellStyle"
    stripe
  >
    <el-table-column
      v-for="(item, index) in tableInfo.columns"
      :key="index"
      :prop="item.props"
      :label="item.label"
      :width="item?.width"
      show-overflow-tooltip
      align="center"
    >
      <template #default="scope">
        <span :class="{ greed_color: item.props === 'zxzt' && scope.row.zxzt === '在线' }">{{
          scope.row[item.props]
        }}</span>
      </template>
    </el-table-column>
    <slot />
  </el-table>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
defineProps({
  tableInfo: {
    type: Object,
    default: () => {
      return {}
    },
  },
  tableData: {
    type: Array,
    default: () => [],
  },
})
// 表头样式
const headerCellStyle = { color: '#fff', backgroundColor: '#209dbe' }
</script>

<style lang="scss" scoped></style>
